package com.ls.utilsTest;

import java.lang.reflect.Type;
import java.util.Map;

import org.junit.Test;

import com.google.gson.reflect.TypeToken;
import com.ls.mq.util.Toolkit;
import com.ls.test.utils.Utils;

public class JsonUtils {

	@Test
	public void testJsontoMap(){
		
		String jsonMap = Toolkit.toJson(Utils.generateMap());
		System.out.println(jsonMap);
		 Type typeOfT = new TypeToken<Map<String,String>>(){}.getType();

		Map<String,String> result = Toolkit.fromJson(jsonMap, typeOfT);
		System.out.println(result.get("b"));
	}
}
